package cn.edu.scau.cmi.wusonglang.client;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import cn.edu.scau.cmi.wusonglang.orm.entity.Student;
import cn.edu.scau.cmi.wusonglang.orm.entity.Tutor;

public class SpringClient {

	public static void main(String[] args) {
		ApplicationContext applicationContext = new ClassPathXmlApplicationContext("./applicationContext.xml");
		Tutor liangzaoqing = (Tutor) applicationContext.getBean("liangzaoqing");
		Student wusonglang = (Student)applicationContext.getBean("wusonglang");
		System.out.println("student:"+wusonglang.getName()+"\nteacher:"+wusonglang.getTutor().getName());
	}
}
